BEGIN TRANSACTION; -- 开始事务
BEGIN TRY
    UPDATE Accounts SET Balance = Balance - 100 WHERE AccountID = 'A001';
    UPDATE Accounts SET Balance = Balance + 100 WHERE AccountID = 'B002';
    COMMIT TRANSACTION; -- 提交事务
END TRY
BEGIN CATCH
    ROLLBACK TRANSACTION; -- 回滚事务
    THROW; -- 抛出错误信息
END CATCH;
